/**
 *
 */
package com.guchenbo.example.encoding;

import java.io.UnsupportedEncodingException;

import static com.guchenbo.example.encoding.HexUtils.toHex;

/**
 * @author Cre.Gu
 */
public class Test2 {
    public static void main(String[] args) throws UnsupportedEncodingException, Exception {

        String s = "I am 君山";
        s = "多听FM";

        char[] c = s.toCharArray();
        toHex(c, "char[]");

        byte[] def = s.getBytes();
        toHex(def, "def");
        byte[] iso = s.getBytes("iso-8859-1");
        toHex(iso, "iso");
        System.out.println(new String(iso, "iso-8859-1"));
        byte[] gb2312s = s.getBytes("gb2312");
        toHex(gb2312s, "gb2312");
        System.out.println(gb2312s);
        byte[] gbks = s.getBytes("gbk");
        toHex(gbks, "gbk");
        byte[] gb18030s = s.getBytes("gb18030");
        toHex(gb18030s, "gb18030");
        byte[] utf8 = s.getBytes("UTF-8");
        toHex(utf8, "utf8");
        byte[] utf16 = s.getBytes("utf-16");
        toHex(utf16, "utf16");
    }


}
